package com.njlime.sys.repository;

import com.njlime.core.helper.PageBean;
import com.njlime.sys.entities.Menu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Map;

/**
 * Created by Dean on 2017-7-27.
 */
public interface MenuDao extends JpaRepository<Menu, Integer>,JpaSpecificationExecutor<Menu> {
    Map<String, Object> getById(Integer id);
    List<Menu> listByUserId(Integer userId);
    List<Menu> findAllList();
    PageBean list(PageBean pageBean, Menu menu);
    int updateMenu(Menu menu);
    int getMaxSort();
    Menu getNextSortMenu(Integer id);
    Menu getBeforeSortMenu(Integer id);
    int countByParentId(Integer parent_id);
    int deleteMenu(Integer id);
    List<Map<String, Object>> getMenuByRole(Integer role_id);
    Menu getByTemplate(String template);
    List<Menu> getMenuChildList(int id);
    Menu getByUrl(String url);
}
